"""i=1
while i<101:
    print("我不喜欢小美")
    i +=1
"""
"""sum = 0
i =0
while i<100:
    print("计算一到一百的和")
    sum += i
    i+=1
"""
import random
num = random.randint(1,100)
count =0
flag = True
while flag:
        guess_num = int(input("请输入你要猜的数字:"))
        count+=1
        if guess_num ==num :
            print ("恭喜你猜对了")
            flag=False
        else:
            if guess_num >=num:
                print("猜大了")
            else:
                print("猜小了")
print(f"你一共猜了{count}次")